package com.zzq.security.util;

import com.zzq.domain.entity.SmilePhotographer;
import com.zzq.util.UUIDUtil;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public  class UserUtil {
    public  static  Long getUserID(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        SmilePhotographer user = (SmilePhotographer) authentication.getPrincipal();
        Long userid = user.getId();
        return userid;
    }
    public  static  SmilePhotographer getUser(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        SmilePhotographer user = (SmilePhotographer) authentication.getPrincipal();
        return user;
    }

}
